The semiconductor integrated circuit (IC) industry has experienced rapid growth. Technological progress in IC manufacture has produced several generations of ICs, and each generation fabricates smaller and more complex circuits than the previous generation. Currently, the semiconductor industry has progressed into nanometer technology nodes for higher device density and better electrical performance, and a variety of challenges from fabrication and design have led semiconductor technologies to three-dimensional designs, such as fin-like field effect transistors (finFETs). Recently, horizontal-gate-all-around (HGAA) transistors have been proposed to surpass finFETs. A typical HGAA transistor is fabricated with one or more nanowire channels horizontally suspending between source/drain regions. In addition, a gate is formed around the nanowire channels. It is beneficial to have a gate wrapping the nanowire channels that allows the gate to control the nanowire channels from all directions. However, as structures of semiconductor devices become more complex, conventional techniques have not been entirely satisfactory in all respects.